package cn.xrj.springcloud;

import com.netflix.hystrix.contrib.metrics.eventstream.HystrixMetricsStreamServlet;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletRegistrationBean;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.context.annotation.Bean;

@SpringBootApplication
@MapperScan("cn.xrj.springcloud.mapper")
@EnableEurekaClient
@EnableDiscoveryClient
public class SpringcloudProviderJobinfo8003Application {

    public static void main(String[] args) {
        SpringApplication.run(SpringcloudProviderJobinfo8003Application.class, args);
    }

    @Bean
    public ServletRegistrationBean registrationBean(){
        ServletRegistrationBean registrationBean=new ServletRegistrationBean(new HystrixMetricsStreamServlet());
        registrationBean.addUrlMappings("/actuator/hystrix.stream");
        return registrationBean;
    }

}
